package com.qfjy.homework.zhangxu;

/**
 * @author: 张旭
 * @date: 30/6/2022 9:36
 * @version: 1.0
 */
public class CustomerFactory {
    public static final String[] names = {"张三","李四","王五","赵六"};

    public static AbstractCustomer getCustomer(String name){
        for (int i = 0; i < names.length; i++) {
            if (names[i].equalsIgnoreCase(name)){
                return new RealCustomer(name);
            }
        }
        return new NullCustomer();
    }
}
